import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
// import * as Sentry from "@sentry/vue"
import 'element-plus/theme-chalk/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import './assets/styles/element.less'
import './assets/styles/index.less'

import { useAxios } from './request/index.js'
import App from './App.vue'
import { router } from './router'
import { log } from './utils/log.js'

const pinia = createPinia()
const app = createApp(App)

log('env', import.meta.env)

// Sentry.init({
//   app,
//   dsn: "https://a25305c33b360449da3ca6f0558f6d30@o4507787755716608.ingest.us.sentry.io/4507791678111744",
//   integrations: [
//     Sentry.browserTracingIntegration(),
//     Sentry.replayIntegration(),
//   ],
//   // Tracing
//   tracesSampleRate: 1.0, //  Capture 100% of the transactions
//   // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
//   tracePropagationTargets: [/^https:\/\/privpreview\.blockjoker\.org\/api/, /^https:\/\/blockjoker\.org\/api/],
//   // Session Replay
//   replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
//   replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
// })

app.use(pinia)
app.use(ElementPlus, {
  locale: zhCn,
})
app.use(router)
useAxios(app, router)

app.mount('#app')
